<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>考卷信息</title>
    <link rel="stylesheet" th:href="@{/static/css/layui.css}">
    <link rel="stylesheet" th:href="@{/static/css/exam/examFinishedInfo.css}">
</head>
<body>

    <div>
        <ul class="layui-nav">
            <li class="layui-nav-item">姓名：</li>
            <li class="layui-nav-item left" th:text="${paper.UName}"></li>
            <li class="layui-nav-item">试卷名：</li>
            <li class="layui-nav-item left" th:text="${paper.PName}"></li>
            <li class="layui-nav-item">交卷时间：</li>
            <li class="layui-nav-item left" th:text="${#dates.format(paper.upPosttime, 'yyyy-MM-dd HH:mm:ss')}"></li>
            <li class="layui-nav-item">选择题得分：</li>
            <li class="layui-nav-item left" th:text="${paper.upChoicescore}"></li>
            <li class="layui-nav-item">简答题得分：</li>
            <li class="layui-nav-item left" th:text="${paper.upShortscore == null ? '未打分' : paper.upShortscore}"></li>
            <li class="layui-nav-item">试卷总分：</li>
            <li class="layui-nav-item left" th:text="${paper.pscore}"></li>
            <li class="layui-nav-item">阅卷人：</li>
            <li class="layui-nav-item left" th:if="${paper.AName == null}"><span style='color:#e1e1e1'>无</span></li>
            <li class="layui-nav-item left" th:if="${paper.AName != null}" th:text="${paper.AName}"></li>
        </ul>
    </div>

    <form class="layui-form">

        <div class="layui-form-item" th:each="question,step: ${questions}" th:switch="${question.QType}">
            <div th:each="answer: ${answers}" th:if="${answer.id == question.QId}">
                <div th:case="'1'">
                    <div class="layui-field-title">
                        <span th:text="${step.count} + '：' + ${question.QTitle} + '（单选题：' + ${question.QScore} + '分）'"></span>
                        <span style="color: red;font-size: 15px;" th:text="'得分：' + ${answer.score} + '分'"></span>
                    </div>
                    <div class="layui-input">
                        <input type="radio" th:name="'single_' + ${question.QId}" th:checked="${answer.answer}" disabled value="A" th:title="'A、' + ${question.QAnswer1}">
                    </div>
                    <div class="layui-input">
                        <input type="radio" th:name="'single_' + ${question.QId}" th:checked="${answer.answer}" disabled value="B" th:title="'B、' + ${question.QAnswer2}">
                    </div>
                    <div class="layui-input">
                        <input type="radio" th:name="'single_' + ${question.QId}" th:checked="${answer.answer}" disabled value="C" th:title="'C、' + ${question.QAnswer3}">
                    </div>
                    <div class="layui-input">
                        <input type="radio" th:name="'single_' + ${question.QId}" th:checked="${answer.answer}" disabled value="D" th:title="'D、' + ${question.QAnswer4}">
                    </div>
                    <div class="layui-field-title info" th:text="'正确答案：' + ${question.QResult}"></div>
                    <div class="layui-field-title info" th:text="'题目解析：' + ${question.QAnalyze == null ? '本题无解析' : question.QAnalyze}"></div>
                </div>
                <div th:case="'2'">
                    <div class="layui-field-title">
                        <span th:text="${step.count} + '：' + ${question.QTitle} + '（多选题：' + ${question.QScore} + '分）'"></span>
                        <span style="color: red;font-size: 15px;" th:text="'得分：' + ${answer.score} + '分'"></span>
                    </div>
                    <div class="layui-input">
                        <input type="checkbox" th:name="'multiple_' + ${question.QId}" lay-skin="primary" th:checked="${answer.answer.contains('A')}" disabled value="A" th:title="'A、' + ${question.QAnswer1}">
                    </div>
                    <div class="layui-input">
                        <input type="checkbox" th:name="'multiple_' + ${question.QId}" lay-skin="primary" th:checked="${answer.answer.contains('B')}" disabled value="B" th:title="'B、' + ${question.QAnswer2}">
                    </div>
                    <div class="layui-input">
                        <input type="checkbox" th:name="'multiple_' + ${question.QId}" lay-skin="primary" th:checked="${answer.answer.contains('C')}" disabled value="C" th:title="'C、' + ${question.QAnswer3}">
                    </div>
                    <div class="layui-input">
                        <input type="checkbox" th:name="'multiple_' + ${question.QId}" lay-skin="primary" th:checked="${answer.answer.contains('D')}" disabled value="D" th:title="'D、' + ${question.QAnswer4}">
                    </div>
                    <div class="layui-field-title info" th:text="'正确答案：' + ${question.QResult}"></div>
                    <div class="layui-field-title info" th:text="'题目解析：' + ${question.QAnalyze.isEmpty() ? '本题无解析' : question.QAnalyze}"></div>
                </div>
                <div th:case="3">
                    <div class="layui-field-title">
                        <span th:text="${step.count} + '：' + ${question.QTitle} + '（简答题：' + ${question.QScore} + '分）'"></span>
                        <span style="color: red;font-size: 15px;" th:text="${paper.AName == null ? '未打分' : '得分：' + answer.score + '分'}"></span>
                    </div>
                    <textarea name="short_${question.qId}" disabled class="layui-textarea" style="resize: none" th:text="${answer.answer}"></textarea>
                    <div class="layui-field-title info" th:text="'正确答案：' + ${question.QResult.isEmpty() ? '无' : question.QResult}"></div>
                    <div class="layui-field-title info" th:text="'题目解析：' + ${question.QAnalyze.isEmpty() ? '本题无解析' : question.QAnalyze}"></div>
                </div>
            </div>
        </div>

    </form>

    <script type="text/javascript" th:src="@{/static/layui.js}"></script>
    <script type="text/javascript" th:src="@{/static/js/jquery-3.2.1.min.js}"></script>
    <script> layui.use(['form'], function(){});</script>
</body>
</html>